<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/StaffTemplate.xhtml">

    <ui:define name="nav_menu">
        <f:view beforePhase="#{staffEditAccessRightsManagedBean.initView}">
            <p:menubar model="#{staffEditAccessRightsManagedBean.staffMenuModel}"/>
        </f:view>
    </ui:define>

    <ui:define name="content">
        <h:form>
            <p:dataTable var="staffAccountState" value="#{staffEditAccessRightsManagedBean.staffAccountState}" id="accessRightList">  

                <f:facet name="header">  
                    #{bundle['staff.viewAllStaff.header']}
                </f:facet>  

                <p:column headerText="ID" style="width:300px">  
                    <h:outputText value="#{staffAccountState.id}" />  
                </p:column>  
                <p:column headerText="Username" style="width:300px">
                    <h:outputText value="#{staffAccountState.username}" /> 
                </p:column>  
                <p:column headerText="Creation Date" style="width:310px">
                    <h:outputText value="#{staffAccountState.creationDate}"> 
                        <f:convertDateTime pattern="yyyy-MM-dd" timeZone="GMT+8" />
                    </h:outputText>
                </p:column>
                <p:column headerText="Birth Date" style="width:310px">
                    <h:outputText value="#{staffAccountState.staff.birthdate}">
                        <f:convertDateTime pattern="yyyy-MM-dd" timeZone="GMT+8" />
                    </h:outputText> 
                </p:column> 
                <p:column headerText="Email" style="width:300px">
                    <h:outputText value="#{staffAccountState.staff.email}" /> 
                </p:column> 
                <p:column headerText="Department" style="width:300px">
                    <h:outputText value="#{staffAccountState.staff.department}" /> 
                </p:column> 
                <p:column headerText="Job Position" style="width:300px">
                    <h:outputText value="#{staffAccountState.staff.jobPosition}" /> 
                </p:column> 
                <p:column headerText="User Role" style="width:300px">
                    <h:outputText value="#{staffAccountState.userRoleType.userRoleType}" /> 
                </p:column> 
                <p:column headerText="Access Rights" style="width:300px">
                    <p:dataList value="#{staffAccountState.accessRights}" var="accessRights">  
                        #{accessRights.accessRight} 
                    </p:dataList>
                </p:column>
            </p:dataTable>  
        </h:form>
    </ui:define>
</ui:composition>
